<template>
    <div @click="test">
        我是子组件
    </div>
</template>

<script setup lang="ts">
import useUserStore from "@/store/modules/user"
let caseStore = useUserStore()
// mutation.events.key 可以判断谁改变了
caseStore.$subscribe((mutation, state) => {
  console.log("子测试订阅:",mutation, state)
})

import { defineEmits } from 'vue';
const emit = defineEmits(['sidebar-click'])
const test = ()=>{
  emit("sidebar-click","ceshi1")
}
</script>

<style scoped>

</style>